package com.spring.gateway.snail.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description TODO
 * @Author xueguoping
 * @Date 2021/5/12 10:26
 */
@Configuration
public class GateWayConfig {

	@Bean
	public RouteLocator routeLocator(RouteLocatorBuilder builder){
		//uri("http://news.baidu.com")
		return builder.routes()
				.route("baidu_route",r -> r.path("/guonei").uri("http://news.baidu.com"))
				.build();
	}
}
